<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../Template/generalTemplate.xhtml">

            <ui:define name="content">
                <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>
                <p:dialog modal="true" widgetVar="statusDialog" header="Generating"   
                          draggable="false" closable="false">  
                    <p:graphicImage value="/images/ajaxloadingbar.gif" />  
                </p:dialog>
                <p:panel id="generateForecastReport" header="Forecast Report" style="height:495px;">
                    <h:form>
                        <p:growl id="growl" showDetail="true" />
                        <div style="margin-top:90px;margin-left:30px;font-weight:bold;font-size: 1.5em;text-align:center;">
                            <div>    
                                <p:commandButton value ="Generate Report" update="growl generateForecastReport" actionListener="#{editForecastTableManagedBean.exportToPDFBySQLConn}" style="width:350px;"/>
                            </div>

                            <div>
                                <p:commandButton value ="View Report" ajax="false" style="width:350px;margin-top:20px;" rendered="#{editForecastTableManagedBean.view}">
                                    <p:fileDownload value="#{fileManagedBean.file}" contentDisposition="inline"/>
                                </p:commandButton>
                            </div>
                        </div>
                    </h:form>
                </p:panel>
            </ui:define>


        </ui:composition>

    </body>
</html>
